package com.zwl.security.uaa.dao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zwl.security.uaa.dao.entity.UserDO;
import com.zwl.security.uaa.dao.mapper.UserMapper;
import com.zwl.security.uaa.dao.service.IUserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 二师兄
 * @since 2021-08-06
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements IUserService {


    @Override
    public UserDO findByUserName(String username) {
        return baseMapper.selectOne(new QueryWrapper<UserDO>().lambda().eq(UserDO::getUsername, username));
    }

    @Override
    public List<String> findPermissionsByUserId(String uid) {
        return baseMapper.findPermissionsByUserId(uid);
    }

}
